A tree data structure can be defined recursively as a collection of nodes starting at a root node. A node is a data structure having at least one value, together with a list of references to nodes, referred to as children. The root node is the top node of the tree. A tree can be analyzed mathematically as a whole. For example, looking at a tree as a whole, one can talk about “the parent node” of a given node, but in general a given node only contains the list of its children, but does not contain a reference to its parent (if any). The children of a node define an ordered forest. For example, a forest may be defined by the union of subtrees given by all the children or equivalently taking the subtree given by the node itself and erasing the root. Just as subtrees are natural for recursion (as in a depth-first search), forests are natural for corecursion (as in a breadth-first search).